//
//  my_settingViewController.m
//  Bullet
//
//  Created by  on 2019/8/14.
//  Copyright © 2019 . All rights reserved.
//

#import "my_settingViewController.h"
#import "my_settingView.h"
#import "my_settingTableViewCell.h"
#import "AgreementViewController.h"
#import "AppDelegate.h"
#import "My_editViewController.h"
#import "QZBackListVC.h"
#import "QZSeeHistoryVC.h"
#import "DJVideoDraftVC.h"
#import "DJMyFeedBackVC.h"
#import "MyAcountSettingVC.h"
#import "MyAboutSettingVC.h"
#import "DJMyWallVC.h"
#import "DJMyCreatorCenterCViewController.h"
#import "DJAttestationzVC.h"
#import "MyPrivacySettingVC.h"

@interface my_settingViewController ()<UITableViewDelegate,UITableViewDataSource>
{
    my_settingView * my_setting;
    NSArray * tipArr;
    AppDelegate * app;
    NSString * ipa_var;
}

@end

@implementation my_settingViewController

-(void)showTextViewNavViewTo1{
    NSMutableArray * showTextViewNavViewNameArrTo1 = [NSMutableArray new];
    UIView * showTextViewNavViewViewTo1 = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
    showTextViewNavViewViewTo1.clipsToBounds = YES;
       UILabel * oldshowSSSSTip = [[UILabel alloc]init];
    oldshowSSSSTip.clipsToBounds = YES;
    oldshowSSSSTip.text = @"kass显示区";
    oldshowSSSSTip.textColor = ColorHex(@"#f0f0f0");
    oldshowSSSSTip.textAlignment = NSTextAlignmentCenter;
    oldshowSSSSTip.font = [UIFont systemFontOfSize:28];
    oldshowSSSSTip.hidden = YES;
    [self.view addSubview:oldshowSSSSTip];
    [self.view addSubview:showTextViewNavViewViewTo1];
    UILabel * showTextViewNavViewLabelTo1 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
    NSInteger showTextViewNavViewNumberTo1 = arc4random_uniform(20);
    NSLog(@"：%ld", (long)showTextViewNavViewNumberTo1);
    showTextViewNavViewLabelTo1.text = [NSString stringWithFormat:@"%ld",(long)showTextViewNavViewNumberTo1];
    [showTextViewNavViewLabelTo1 addSubview:showTextViewNavViewLabelTo1];
    
    UIImageView * showTextViewNavViewLabelTo2 = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
    [showTextViewNavViewViewTo1 addSubview:showTextViewNavViewLabelTo2];
    
}
- (void)showOldAddNavViewToMainOldView1{
    UIView * oldBgSS = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
    oldBgSS.clipsToBounds = YES;
       UILabel * oldshowSSSSTip = [[UILabel alloc]init];
    oldshowSSSSTip.clipsToBounds = YES;
    oldshowSSSSTip.text = @"kass显示区";
    oldshowSSSSTip.textColor = ColorHex(@"#f0f0f0");
    oldshowSSSSTip.textAlignment = NSTextAlignmentCenter;
    oldshowSSSSTip.font = [UIFont systemFontOfSize:28];
    oldshowSSSSTip.hidden = YES;
    [self.view addSubview:oldshowSSSSTip];
    [self.view addSubview:oldBgSS];
    
    UIButton * sendBtn = [[UIButton alloc]initWithFrame:CGRectMake(KScreen_W-75, kStatusBarHeight+10, 60, 46)];
    sendBtn.layer.cornerRadius = 3;
    sendBtn.backgroundColor = [UIColor whiteColor];
    [sendBtn setTitle:@"发送" forState:UIControlStateNormal];
    [sendBtn setTitleColor:ColorHex(@"#333333") forState:UIControlStateNormal];
    sendBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    [sendBtn addTarget:self action:@selector(sendTap) forControlEvents:UIControlEventTouchUpInside];
    [oldBgSS addSubview:sendBtn];
    
    UIView * sendBg = [[UIView alloc]initWithFrame:CGRectMake(15, kStatusBarHeight+66, KScreen_W-30, (KScreen_H-KSafeAreaBottomHeight-25-(kStatusBarHeight+66))/2)];
    sendBg.backgroundColor = [UIColor whiteColor];
    sendBg.layer.cornerRadius = 3;
    [oldBgSS addSubview:sendBg];
    
    UILabel * sendTip = [[UILabel alloc]initWithFrame:CGRectMake(0, (sendBg.frame.size.height-40)/2, sendBg.frame.size.width, 40)];
    sendTip.text = @"发送区";
    sendTip.textColor = ColorHex(@"#f0f0f0");
    sendTip.textAlignment = NSTextAlignmentCenter;
    sendTip.font = [UIFont systemFontOfSize:28];
    [sendBg addSubview:sendTip];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"设置";
    app = (AppDelegate *)[UIApplication sharedApplication].delegate;
    self.view.backgroundColor = viewback_black;
    my_setting = [[my_settingView alloc]initWithFrame:CGRectMake(0, 0, KScreen_W, KScreen_H)];
       UILabel * oldshowSSSSTip = [[UILabel alloc]init];
    oldshowSSSSTip.clipsToBounds = YES;
    oldshowSSSSTip.text = @"kass显示区";
    oldshowSSSSTip.textColor = ColorHex(@"#f0f0f0");
    oldshowSSSSTip.textAlignment = NSTextAlignmentCenter;
    oldshowSSSSTip.font = [UIFont systemFontOfSize:28];
    oldshowSSSSTip.hidden = YES;
    [self.view addSubview:oldshowSSSSTip];
    [self.view addSubview:my_setting];
    my_setting.my_setting_tableView.delegate = self;
    my_setting.my_setting_tableView.dataSource = self;
    my_setting.my_setting_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return my_setting.my_settingArr.count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 60;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    my_settingTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"my_cell"];
    if (cell == nil) {
        cell = [[my_settingTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"setting_cell"];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    [cell settingConfig:my_setting.my_settingArr[indexPath.row]];
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if ([my_setting.my_settingArr[indexPath.row][@"titleName"] isEqualToString:@"账号管理"]) {
        MyAcountSettingVC * view = [[MyAcountSettingVC alloc] init];
        [self.navigationController pushViewController:view animated:YES];
    }else if ([my_setting.my_settingArr[indexPath.row][@"titleName"] isEqualToString:@"黑名单"]) {
        QZBackListVC * view = [[QZBackListVC alloc] init];
        [self.navigationController pushViewController:view animated:YES];
    }else if ([my_setting.my_settingArr[indexPath.row][@"titleName"] isEqualToString:@"历史浏览"]) {
        QZSeeHistoryVC * view = [[QZSeeHistoryVC alloc] init];
        [self.navigationController pushViewController:view animated:YES];
    }else if ([my_setting.my_settingArr[indexPath.row][@"titleName"] isEqualToString:@"草稿箱"]) {
        DJVideoDraftVC * view = [[DJVideoDraftVC alloc] init];
        [self.navigationController pushViewController:view animated:YES];
    }else if ([my_setting.my_settingArr[indexPath.row][@"titleName"] isEqualToString:@"意见反馈"]) {
        DJMyFeedBackVC * view = [[DJMyFeedBackVC alloc]init];
        [self.navigationController pushViewController:view animated:YES];
    }else if ([my_setting.my_settingArr[indexPath.row][@"titleName"] isEqualToString:@"关于APP"]) {
        MyAboutSettingVC * about = [MyAboutSettingVC new];
        [self.navigationController pushViewController:about animated:YES];
    }else if ([my_setting.my_settingArr[indexPath.row][@"titleName"] isEqualToString:@"我的钱包"]) {
        DJMyWallVC * about = [DJMyWallVC new];
        [self.navigationController pushViewController:about animated:YES];
    }else if ([my_setting.my_settingArr[indexPath.row][@"titleName"] isEqualToString:@"创作中心"]) {
        DJMyCreatorCenterCViewController * about = [DJMyCreatorCenterCViewController new];
        [self.navigationController pushViewController:about animated:YES];
    }else if ([my_setting.my_settingArr[indexPath.row][@"titleName"] isEqualToString:@"创作认证"]) {
        DJAttestationzVC * about = [DJAttestationzVC new];
        [self.navigationController pushViewController:about animated:YES];
    }else if ([my_setting.my_settingArr[indexPath.row][@"titleName"] isEqualToString:@"隐私设置"]) {
        MyPrivacySettingVC * privacy = [MyPrivacySettingVC new];
        [self.navigationController pushViewController:privacy animated:YES];
    }
}
#pragma mark 设置事件
-(void)my_settingTap:(UIButton *)sender{
    
}

@end
